package com.gzbsoft.sc.modules.sys.entity;
import io.ebean.annotation.DbComment;
import io.ebean.annotation.DocEmbedded;
import io.ebean.annotation.DocStore;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import java.math.BigDecimal;
@DocStore
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@Entity
@DbComment("商品配置详情表")
@Table(name = "jx_good_specs_detail")
public class JxGoodSpecsDetail extends BaseEntity {
    @DocEmbedded(doc = "id, title")
    @OneToOne
    @JoinColumn(name = "jx_good_id")
    private JxGood good;
    @DbComment("名称")
    private String name;
    @OneToOne
    @JoinColumn(name = "jx_good_sku_id")
    private JxGoodSku sku;
    @DbComment("是否必须")
    private Boolean required;
    @DbComment("品牌")
    private String brand;
    @DbComment("产地")
    private String origin;
    @DbComment("是否可搜索")
    private Boolean searchable;
    @DbComment("型号")
    private String model;
    @DbComment("类型")
    private String type;
    @DbComment("价格")
    private BigDecimal price;
    @Override
    public String toString() {
        return "JxGoodSpecsDetail{" +
                "good=" + good +
                ", name='" + name + '\'' +
                ", sku=" + sku +
                ", required=" + required +
                ", brand='" + brand + '\'' +
                ", origin='" + origin + '\'' +
                ", searchable=" + searchable +
                ", model='" + model + '\'' +
                ", type='" + type + '\'' +
                ", price=" + price +
                ", id=" + id +
                '}';
    }
}
